package com.example.train.infra.repository.impl;

import com.example.train.domain.entity.Employee;
import com.example.train.domain.repository.EmployeeRepository;
import com.example.train.infra.mapper.EmployeeMapper;
import org.springframework.stereotype.Component;

import java.util.List;

/**
 * @Author: chundong.huang@hand-china.com
 * @Date: 2023/3/25 15:35
 */
@Component
public class EmployeeRepositoryImpl implements EmployeeRepository {

    private final EmployeeMapper employeeMapper;

    public EmployeeRepositoryImpl(EmployeeMapper employeeMapper) {
        this.employeeMapper = employeeMapper;
    }

    @Override
    public List<Employee> list(Long id) {
        return employeeMapper.list(id);
    }

    @Override
    public int del(Long id) {
        return employeeMapper.del(id);
    }

    @Override
    public int update(Employee employee) {
        return employeeMapper.update(employee);
    }

    @Override
    public int insert(Employee employee) {
        return employeeMapper.insert(employee);
    }
}
